package org.example.spring_blog.service;

import org.example.spring_blog.mapper.BlogInfoMapper;
import org.example.spring_blog.model.BlogInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BlogInfoService {

    @Autowired
    BlogInfoMapper blogInfoMapper;
    public List<BlogInfo> selectAll() {
        return blogInfoMapper.selectAll();
    }

    public BlogInfo selectById(Integer id) {
        return blogInfoMapper.selectById(id);
    }

    public int addBlog(BlogInfo blogInfo) {
        return blogInfoMapper.insertBlog(blogInfo);
    }

    public Integer updateBlog(BlogInfo blogInfo) {
        return blogInfoMapper.updateBlog(blogInfo);
    }

    public Integer deleteBlog(BlogInfo blogInfo) {
        return blogInfoMapper.updateBlog(blogInfo);
    }
}
